/**
 * Created by zhangguoyu on 16/4/28.
 */
var StatusController = function () {};

StatusController.prototype.currentStatus = function (req, res) {
  var self = this;
  res.json({
    code: 1,
    msg: 'ok',
    result: {
      logType: self.$application.status.currentLogType,
      progress: self.$application.status.currentProgress,
      total: self.$application.status.totalSize,
      current: self.$application.status.current
    }
  })
};

StatusController.prototype.onRouting = function (router) {
  var self = this;
  router.get('/current', function (req, res, next) {
    self.currentStatus.call(self, req, res, next);
  });
};

module.exports = StatusController;